package main

import (
	"fmt"
	"time"
)

func main() {
	//type关键字（类型别名）
	var myInt myInt = 10086
	int := 20
	fmt.Println(myInt) //10086
	int = myInt
	fmt.Println(int) //10086
	int = 20
	myInt = int
	fmt.Println(myInt) //20

	var myString myString = "a"
	fmt.Printf("%T\n", myString) //main.myString
}

//新类型
type myString string

//取别名
type myInt = int

type myDuration time.Duration

//非本地包不能通过取别名添加方法
func (d myDuration) test() {

}
